import 'package:flutter/material.dart';

class StepperDemo extends StatefulWidget {
  StepperDemo({Key key}) : super(key: key);

  @override
  _StepperDemoState createState() => _StepperDemoState();
}

class _StepperDemoState extends State<StepperDemo> {
  int _currentStepper = 0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('StepperDemo'),
        elevation: 0.0
      ),
      body: Container(
        padding: EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Theme(
              data: Theme.of(context).copyWith(
                primaryColor: Colors.black
              ), 
              child: Stepper(
                currentStep: _currentStepper,
                onStepTapped: (int index) {
                  setState(() {
                    _currentStepper = index;
                  });
                },
                onStepContinue: () {
                  setState(() {
                    _currentStepper < 2 ? _currentStepper += 1 : _currentStepper = 0;
                  });
                },
                onStepCancel: () {
                  setState(() {
                    _currentStepper>0 ? _currentStepper -= 1 : _currentStepper = 2;
                  });
                },
                steps: [
                  Step(
                    title: Text('Login'),
                    subtitle: Text('LoginTitle'),
                    content: Text('just a long long content to let you see and do you know what i mead'),
                    isActive: _currentStepper == 0
                  ),
                  Step(
                    title: Text('Login'),
                    subtitle: Text('LoginTitle'),
                    content: Text('Just a long long content to let you see and do you know what i mead'),
                    isActive: _currentStepper == 1
                  ),
                  Step(
                    title: Text('Login'),
                    subtitle: Text('LoginTitle'),
                    content: Text('just a long long content to let you see and do you know what i mead'),
                    isActive: _currentStepper == 2
                  ),
                ]
              )
            )
          ],
        ),
      ),
    );
  }
}